import {Base} from './base.js'

class Home extends Base{
  constructor() { 
    super()
  }

  getBannerData(callback)
  {
    var params = {
      url: 'banner/1',
      fn:function (res) {
        callback && callback(res)
      }
    }
    this.request(params)
  }

  getThemeData(callback){
    var params= {
      url:'theme?ids=1,2,3',
      fn:function(res){
        callback&&callback(res)
      }
    }
    this.request(params)
  }

  getBookData(page, callback){
    page = page || ""
    var params = {
      url: 'books?page=' + page,
      fn: function (res) {
        callback && callback(res)
      }
    }
    this.request(params)
  }

  getCategories(callback){
    var params = {
      url: 'categories',
      fn: function (res) {
        callback && callback(res)
      }
    }
    this.request(params)
  }
}

export {Home}